package com.fzu.ess.sys.service;

import com.fzu.ess.common.Model.JsonModel;
import com.fzu.ess.sys.entity.User;

import java.util.List;

/**
 * Created by ercha on 2015/10/16.
 */
public interface UserService {

    JsonModel login(String username, String password, Boolean rememberMe);

    void logout();

    User findByUsername(String username);

    User findByEmail(String email);

    User findByNameOrEmail(String nameOrEmail);

    List<User> getAllAdmin();

    //返回值为新密码
    String resetPassword(String email);

    boolean confirmPassword(String password);

    JsonModel updatePassword(String oldPassword, String password);

    JsonModel register(User user);

    /**
    * 〈activeUser〉:
    *  激活账号。code
    *
    * @Date	2015/11/30/22:54
    * @author ercha
    * @methodName activeUser
    * @param [ uuid, code] code 为 uuid + email，以逗号分隔。base64 编码
    * @return
    * @throws [null]
    * @History:// 历史修改记录
    *	<author>  // 修改人1
    *   <time>    // 修改时间
    *   <desc>    // 描述修改内容
    **/
    JsonModel activeUser(String uuid, String code);

    JsonModel createAdmin(User admin);

    JsonModel adminPageData(Integer pageNumber, Integer pageSize, String filter);

    JsonModel deleteAdmin(String id);

    JsonModel resetAdminPassword(String id, String password);
}
